How to build a blog with sphinx?#
Quick start#
Clone the Template Project
git clone https://github.com/choldgraf/choldgraf.github.io.git
Install nox.
pip install -U nox
Run nox
nox -s docs
this should install a Sphinx environment and build the site, putting the output files in _build/html.
Make your website#
The template project is a demo.The information is all about Chris Holdgraf, you should make it to yourself.
About me#
There are three files containing the personal informantion. You should change the following files:
index.md
about.md
_templates/hello.html
also you shuold replace the following images:
_static/favicon.ico
_static/profile.jpg
_static/profile_bw.png
delete or replace the two files: _static/works.bib and cv.pdf
Other catalog#
Sidebars#
conf.py
html_sidebars = {
"index": ["hello.html"],
"about": ["hello.html"],
#"publications": ["hello.html"],
#"projects": ["hello.html"],
#"talks": ["hello.html"],
"posts/**": ['postcard.html', 'recentposts.html', 'archives.html','categories.html'],
"blog": ['tagcloud.html', 'archives.html','categories.html'],
"blog/**": ['postcard.html', 'recentposts.html', 'archives.html','categories.html']
}
giscus.app#
Publish your website#
https://www.sphinx-doc.org/en/master/tutorial/deploying.html#id5
Others#
How to handle the image location?
Just put the images in the same catalog with markdown files.
Image name cann’t have any white space.For example, ‘im a image.jpg’ is not correct.You should name it ‘im_a_image.jpg’ .
Ad#
https://www.ethicalads.io/publishers/?ref=rtd-sidebar-join
附件如何处理?#
https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#referencing-downloadable-files
here is a pdf file :download:pdf <doc/mypdf.pdf>
.. image:: doc/mypdf.pdf
Social network#